<?php
/**
 * @package Freshine
 * @since Freshine 2.0.0
 */
 
function f9_register_js() {
	if (!is_admin()) {
		wp_deregister_script('jquery');
		wp_register_script('jquery', get_bloginfo('template_url') . '/js/jquery.min.js' );
		wp_register_script('f9_sfmenu', get_bloginfo('template_url') . '/js/superfish.js', 'jquery');
		wp_register_script('f9_custom', get_bloginfo('template_url') . '/js/custom.js', 'jquery');
		wp_register_script('f9_form_example', get_bloginfo('template_url') . '/js/form-example.js', 'jquery');
		
		wp_enqueue_script('jquery');
		wp_enqueue_script('f9_sfmenu');
		wp_enqueue_script('f9_custom');
		wp_enqueue_script('f9_form_example');
	}
}
add_action('init', 'f9_register_js');

// load single scripts only on single pages
function f9_single_scripts() {
	if ( is_singular() && get_option( 'thread_comments' ) ) wp_enqueue_script( 'comment-reply' ); // loads the javascript required for threaded comments 
}
add_action('wp_print_scripts', 'f9_single_scripts');